//**************************************************************************************************************
// CLASS: TextSegment
//
// DESCRIPTION
// Maintains the text segment. The text segment has two data members: a Dictionary of the labels, and a Vector
// of the instructions. TextSegment is derived from Segment.
//
// AUTHOR INFORMATION
// Group 2
// Tyler Williams
// Lauren Walker
// Cameron Stewart
// Fatimah Alowah
//**************************************************************************************************************
// Preprocess guard.
#ifndef TEXTSEGMENT_HPP
#define TEXTSEGMENT_HPP

// Figure out what header file you have to include to use the C++ STL std::map class.
#include <map>

// Figure out what header file you have to include to use the C++ STL std::vector class.
#include <vector>

#include <string>
#include "Instr.hpp"
#include "Label.hpp"
#include "Segment.hpp"
#include "Types.hpp"

//==============================================================================================================
// CLASS: TextSegment (derived from Segment)
//==============================================================================================================

// Write the class declaration.
class TextSegment : public Segment {

public:
//
//Constructor
//
TextSegment
    (
    Address const pAddress = 0
    );
//
//Copy constructor
//
TextSegment
    (
    TextSegment const& pSeg
    );

//
//Destructor
//
~TextSegment
	(
	);

void AddInstr
	(
	Instr* pInstr
	);

void AddLabel
	(
	Label const& pLabel
	);

Byte *GetContents
    (
    )
    const;

Label GetLabel
    (
    std::string const& pName
    );

uint32 GetSize
    (
    )
    const;

TextSegment& operator=
    (
    TextSegment const& pTextSegment
    );

protected:

void Copy
    (
    TextSegment const& pTextSegment
    );

private:

    //----------------------------------------------------------------------------------------------------------
    // Declare a data member named mInstrs which is an object of the templated STL class vector<Instr>.
    //----------------------------------------------------------------------------------------------------------
    std::vector<Instr> mInstrs;

    //----------------------------------------------------------------------------------------------------------
    // Declare a data member named mLabels which is an object of the templated STL class map<std::string,
    // Label>.
    //----------------------------------------------------------------------------------------------------------
    std::map<std::string, Label> mLabels;
};

// End preprocessor guard.
#endif

